package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.repository.UserInfoTemplateSearchRepository;
import cn.wolfcode.luowowo.search.service.UserInfoTemplateSearchService;
import cn.wolfcode.luowowo.search.template.UserInfoTemplate;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

import java.util.List;

@Service
public class UserInfoTemplateSearchServiceImpl implements UserInfoTemplateSearchService {

    @Autowired
    private ElasticsearchTemplate template;

    @Autowired
    private UserInfoTemplateSearchRepository userInfoTemplateRepository;

    @Override
    public void saveOrUpdate(UserInfoTemplate userInfo) {
        userInfoTemplateRepository.save(userInfo);
    }

    @Override
    public List<UserInfoTemplate> queryByDestName(String destName) {
        return userInfoTemplateRepository.findByDestName(destName);
    }
}
